function main(params) {
    debugger
    const self = this;
    const pageRootList = self.$$roots();
    // 节点参数
    console.log(params);

    api.EXEC_FORMULA("TREE_QUERY_CHILDRENS('2ba02e87-b055-4875-a113-9a599f3894f5','" + params.id + "',['unit_id'])").then((res) => {
        // then() 为调用成功的回调
        // 获取所有子区划
        const unitIdList = res.result;

        let unitId = unitIdList.join(',');

        let elementId = {
            pageTableListId: '',
            queryElementId: '',
            tableConditionId: ''
        }

        elementId.pageTableListId = 'page_widget_list_542ty1';
        elementId.queryElementId = 'query_field_wrapper_6osicr';
        elementId.tableConditionId = 'condition_coyesi';
        doQueryCard(self, elementId, unitIdList);

    }).catch(err => {
        self.$message.error(err.message); // 显示错误提示信息
    });
}


function doQueryCard(self, elementId, unitId) {
    let pageTableList = self.$$(elementId.pageTableListId);
    if (pageTableList) {
        if (pageTableList.dataEngine && pageTableList.dataEngine.state) {
            let queryElement = pageTableList.dataEngine.state.getElement(elementId.queryElementId);
            if (queryElement && queryElement.data && queryElement.data.members) {
                const queryProjectIdModel = queryElement.data.members[0];
                queryProjectIdModel.props.defaultValue.value = unitId;
            }
            let tableCondition = pageTableList.dataEngine.state.getElement(elementId.tableConditionId);
            if (tableCondition) {
                setTimeout(()=>{
                    tableCondition.onQuery();
                })
            }
        }
    }

}
